Skip to content

Docker publish workflow#115

Merged
TatevikGr merged 7 commits into
devfrom
docker-publish
May 18, 2026
Merged

Docker publish workflow#115
TatevikGr merged 7 commits into
devfrom
docker-publish

Conversation

@TatevikGr
Copy link
Copy Markdown
Contributor

@TatevikGr TatevikGr commented May 11, 2026

Summary

Thanks for contributing to phpList!

Summary by CodeRabbit

  • Chores
    • Configured application to run on port 8081 instead of port 80
    • Updated environment configuration URLs to reflect new port settings
    • Implemented automated Docker image building and publishing workflow for consistent releases

Review Change Stack

TatevikGr and others added 3 commits May 3, 2026 19:17
    New Features
        Modern frontend build and bundling setup with Node/Yarn support and asset compilation
        CORS support enabled for API compatibility

    Chores
        Updated build tooling and runtime dependencies; added image processing support in the runtime environment
        Docker and compose improvements for build steps and persistent logs/cache; adjusted ignore rules

    Tests
        Added test bootstrap and improved server-error assertion in endpoint tests

    Documentation
        Added instructions to build and publish frontend assets

---------

Co-authored-by: Tatevik <tatevikg1@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@TatevikGr has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 76d4ceb5-cfd3-4805-af6c-133a1e9bec1d

📥 Commits

Reviewing files that changed from the base of the PR and between d683f41 and a1c999a.

📒 Files selected for processing (2)
  • .github/workflows/docker-publish.yml
  • docker-compose.yml
📝 Walkthrough

Walkthrough

This PR migrates the PHPLIST application from listening on port 80 to port 8081 by adding Apache vhost configuration, updating Docker Compose port mapping and environment URLs, mounting Apache configs into the container, and introducing a GitHub Actions workflow for automated Docker image building and publishing to Docker Hub.

Changes

Port 8081 Migration

Layer / File(s) Summary
Apache Configuration
docker/apache/ports.conf, docker/apache/servername.conf, docker/apache/000-default.conf
Apache configuration files added: Listen 8081 directive for port, ServerName app for vhost identity, and VirtualHost *:8081 configuration serving /var/www/html/public with .htaccess override support and request logging.
Docker Compose Port and Mounts
docker-compose.yml
app service port mapping changed from 80 to 8081; read-only volume mounts added for Apache configuration files (server_name.conf, ports.conf, 000-default.conf) into the container.
Docker Compose URLs
docker-compose.yml
Environment variables REST_API_BASE_URL, FRONT_END_BASE_URL, and API_BASE_URL updated from http://app/ to http://app:8081/ to reflect the new port.
GitHub Actions Publishing Workflow
.github/workflows/docker-publish.yml
New CI/CD workflow added that builds and publishes Docker images on docker-publish branch pushes, v* tag pushes, and pull requests to docker-publish; configures multi-platform builds (linux/amd64, linux/arm64) using QEMU and Docker Buildx; authenticates to Docker Hub only for non-pull-request events using secrets; generates image tags and labels from repository metadata.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • phpList/base-distribution#107: Both PRs modify Docker and GitHub Actions configuration in the repository, with overlapping changes to CI/workflow and Docker setup.
  • phpList/base-distribution#110: Both PRs modify Docker-related configuration including docker-compose.yml and container/Apache settings for the app service.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Docker publish workflow' is partially related to the changeset but misses the key configuration changes to docker-compose.yml and Apache configs that are equally important parts of this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docker-publish

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
.github/workflows/docker-publish.yml (1)

19-19: 💤 Low value

Consider using ubuntu-latest for automatic updates.

The workflow specifies ubuntu-22.04 explicitly. While this provides consistency, using ubuntu-latest would automatically benefit from GitHub's runner updates and security patches without requiring workflow changes.

Suggested change
   docker:
-    runs-on: ubuntu-22.04
+    runs-on: ubuntu-latest
     permissions:
       contents: read
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docker-publish.yml at line 19, Update the GitHub Actions
runner specification by changing the runs-on value from "ubuntu-22.04" to
"ubuntu-latest" so the workflow automatically uses GitHub's updated Ubuntu
runner; locate the runs-on: ubuntu-22.04 entry in the workflow file and replace
it with runs-on: ubuntu-latest, then run or validate the workflow to ensure no
runner-specific assumptions break.
docker/apache/000-default.conf (1)

1-12: Consider mounting the VirtualHost config directly to sites-enabled or explicitly enabling the site.

The configuration is mounted to /etc/apache2/sites-available/, relying on a pre-existing symlink from the base php:8.1-apache image to activate it. For clarity and to follow Apache best practices, either:

  • Mount directly to /etc/apache2/sites-enabled/000-default.conf, or
  • Add a2ensite 000-default to the startup command in docker-compose

This removes ambiguity about whether the site is properly enabled.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docker/apache/000-default.conf` around lines 1 - 12, The VirtualHost entry
(VirtualHost *:8081, ServerName app in 000-default.conf) is being mounted into
sites-available and may not be enabled; either mount this config directly into
the sites-enabled location (e.g., as 000-default.conf) so Apache picks it up, or
ensure the container startup enables it by adding a2ensite 000-default to the
service startup/entrypoint in docker-compose; update the compose mount or
startup command accordingly so the VirtualHost is unambiguously enabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/docker-publish.yml:
- Around line 3-12: The workflow currently only triggers for the branch named
"docker-publish" under the on: push and on: pull_request blocks; update those
blocks so they include "main" (e.g., add "main" alongside "docker-publish" in
the branches lists for push and pull_request) so pushes and PRs to main will
trigger the workflow while leaving the tags ('v*') behavior unchanged; refer to
the "on: push" and "on: pull_request" sections in the workflow file to make this
change.
- Around line 44-47: The current tag entry
"type=raw,value=test,enable={{is_default_branch}}" won't apply on the
docker-publish branch; update the tags section so the "test" tag is enabled when
building from the intended branch (either change the enable condition from
is_default_branch to a branch-name check for "docker-publish" or other target
branch, or change the workflow trigger to run on the default branch), e.g.,
modify the enable expression for the tag in the tags block (the line referencing
type=raw,value=test,enable={{is_default_branch}}) or adjust the workflow
triggers so they align.
- Line 15: The workflow is publishing to a personal Docker Hub image: the
DOCKERHUB_IMAGE variable currently set to "tatevikg1/phplist4" should be changed
to the official organization image (e.g., "phplist/base-distribution" or your
org's canonical repo) to ensure proper ownership and continuity; update the
DOCKERHUB_IMAGE value in the workflow and also rotate/update any related secrets
(Docker Hub username/password or token referenced by the workflow) to use the
organization account credentials so the publish step continues to authenticate
and push successfully.

In `@docker-compose.yml`:
- Line 4: Replace the personal Docker Hub image reference "image:
tatevikg1/phplist:test" with the organization's Docker Hub repository (e.g.,
"image: <ORG_USERNAME>/phplist:test"); update the image value in the
docker-compose service where "image: tatevikg1/phplist:test" appears so it
points to the organization account and tag used by your CI/workflows.

---

Nitpick comments:
In @.github/workflows/docker-publish.yml:
- Line 19: Update the GitHub Actions runner specification by changing the
runs-on value from "ubuntu-22.04" to "ubuntu-latest" so the workflow
automatically uses GitHub's updated Ubuntu runner; locate the runs-on:
ubuntu-22.04 entry in the workflow file and replace it with runs-on:
ubuntu-latest, then run or validate the workflow to ensure no runner-specific
assumptions break.

In `@docker/apache/000-default.conf`:
- Around line 1-12: The VirtualHost entry (VirtualHost *:8081, ServerName app in
000-default.conf) is being mounted into sites-available and may not be enabled;
either mount this config directly into the sites-enabled location (e.g., as
000-default.conf) so Apache picks it up, or ensure the container startup enables
it by adding a2ensite 000-default to the service startup/entrypoint in
docker-compose; update the compose mount or startup command accordingly so the
VirtualHost is unambiguously enabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 078c070d-712c-4878-8faa-f7a5ab81162b

📥 Commits

Reviewing files that changed from the base of the PR and between 6b8196b and d683f41.

📒 Files selected for processing (5)
  • .github/workflows/docker-publish.yml
  • docker-compose.yml
  • docker/apache/000-default.conf
  • docker/apache/ports.conf
  • docker/apache/servername.conf

Comment thread .github/workflows/docker-publish.yml
workflow_dispatch:

env:
DOCKERHUB_IMAGE: tatevikg1/phplist4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Major: Use organization Docker Hub account instead of personal account.

The workflow uses tatevikg1/phplist4, which appears to be a personal Docker Hub account. For the official phpList project, this should use an organization account (e.g., phplist/base-distribution or similar) to ensure:

  • Proper ownership and access control
  • Continuity if the personal account becomes unavailable
  • Professional branding for the official project
📝 Suggested change
 env:
-  DOCKERHUB_IMAGE: tatevikg1/phplist4
+  DOCKERHUB_IMAGE: phplist/base-distribution

Note: Update the corresponding secrets to use the organization account credentials.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DOCKERHUB_IMAGE: tatevikg1/phplist4
env:
DOCKERHUB_IMAGE: phplist/base-distribution
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docker-publish.yml at line 15, The workflow is publishing
to a personal Docker Hub image: the DOCKERHUB_IMAGE variable currently set to
"tatevikg1/phplist4" should be changed to the official organization image (e.g.,
"phplist/base-distribution" or your org's canonical repo) to ensure proper
ownership and continuity; update the DOCKERHUB_IMAGE value in the workflow and
also rotate/update any related secrets (Docker Hub username/password or token
referenced by the workflow) to use the organization account credentials so the
publish step continues to authenticate and push successfully.

Comment thread .github/workflows/docker-publish.yml
Comment thread docker-compose.yml
@TatevikGr TatevikGr changed the base branch from main to dev May 18, 2026 09:09
@TatevikGr TatevikGr merged commit 8aef04b into dev May 18, 2026
5 checks passed
@TatevikGr TatevikGr deleted the docker-publish branch May 18, 2026 10:21
@coderabbitai coderabbitai Bot mentioned this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants